<?php
$lines_limit=5;
$lines_total=lines_total('menu');
$links_limit=1;
$links_total=links_total($lines_total,$lines_limit);
$sql="select * from menu,type where menu.type_id=type.type_id";
$query=paging_query($sql,$lines_limit);
?>
<table id="tablemenu">
<tr>
	<th>Tên món ăn</th><th>Hình ảnh</th><th>Giá tiền</th><th>Phân loại</th><th>Sửa</th><th>Xóa</th>
</tr>
<?php
	while($data=mysql_fetch_assoc($query)){	
		echo "<tr>";
			echo "<td>$data[name]</td>";
			echo "<td><img src='../img/$data[image]'></img></td>";
			echo "<td>$data[price] VND</td>";
			echo "<td>$data[type_name]</td>";			
			echo "<td><a href='index.php?page=edit_menu&id=$data[mid]'>Sửa</a></td>";
			echo "<td><a href='index.php?page=delete_menu&id=$data[mid]' onclick='return confirmdelete()'>Xóa</a></td>";
		echo "</tr>";
	}	
?>
</table>
<?php
echo "<div id='paging'>";
paging_links1($links_total,$links_limit);
paging_list($links_total);
echo "</div>";
?>